/////////////////////////////////////////////////////////////////////////////////////////////
//
//      COPYRIGHT 2010 MYLES HATHCOCK
//
//      This source code is provided for all, Open-Source, under this OpenBSD License.
//      It follows all terms and agreements listed there.
//
//      All structure code comments should be in doxygen format.
//
/////////////////////////////////////////////////////////////////////////////////////////////

//  All headers have built in protection, just include them.
#include "SAT_HardwareExecutor.hpp"

using namespace std;

int main( int argc, char** argv )
{
    /// INITIALIZE VARS
    END = false;

    /// Call initialization on stuff!
    cSAT_Timer.SetFrequency( 50 );

    // Uncomment if you want timer debug output on stdout
    //cSAT_Timer.EnableDebugOutput();

    //  Lets handle our command line arguments in an easy to read manner!
    //cSAT_CommandLine.HandleCommandLineArgs( argc, argv );

    //  Instead of having a separate class handle the LIVE execution, lets just do it here.
    //  This is SIMPLEAutoTurret after all.

    while ( !END )
    {
        //  This is the instance of cTimingManager that was created to handle hardware execution.
        cSAT_Timer.StartTimer();

        //  Now that the timer has been started, we need to read vars from the local sockets
//        cSAT_SocketManager.ReadVars();

        //  After reading the vars from localhost, we can go ahead and update our servo hardware
        //  by communicating with the Maestro USB controller via virtual serial port (COM0)
//        cSAT_ServoManager.UpdateServos();

        //  Before finishing the RTI, we will check with the socket manager to see if we've recieved the END flag.
//        END = cSAT_SocketManager.GetEnd();

        //  Now our servos are updated, lets go ahead and call our timer to wait the appropriate amount of time.
        cSAT_Timer.FinishRTI();

    }

}
